import {ElMessage, ElNotification} from "element-plus";

export const SUCCESS_STR: string = 'success';
export const ERROR_STR: string = 'error';
export const WARNING_STR: string = 'warning';
export const INFO_STR: string = 'info';

/**
 * 提示信息
 * @param type 提示类型
 * @param message 提示信息
 */
export const elMessageTip = (type: string, message: string) => {
    switch (type) {
        case SUCCESS_STR:
            successMessageTip(message);
            break;
        case ERROR_STR:
            errorMessageTip(message);
            break;
        case WARNING_STR:
            warningMessageTip(message);
            break;
        case INFO_STR:
            infoMessageTip(message);
            break;
        default:
            break;
    }
}

/**
 * 成功
 * @param message 提示信息
 */
export const successMessageTip = (message: string)  => {
    ElMessage.success(message)
}

/**
 * 异常
 * @param message 提示信息
 */
export const errorMessageTip = (message: string) => {
    ElMessage.error(message)
}

/**
 * 警告
 * @param message 提示信息
 */
export const warningMessageTip = (message: string) => {
    ElMessage.warning(message)
}

/**
 * 信息
 * @param message 提示信息
 */
export const infoMessageTip = (message: string) => {
    ElMessage.info(message)
}

